// 演示 lodash
// first / last /  toUpper / reverse / each / includes / find / findIndex

const _ = require('lodash');

const array = ['jack', 'tom', 'lucy', 'kate'];


console.log(_.first(array));
console.log(_.last(array));

console.log(_.toUpper(_.first(array)));

// lodash 使用的是 js 数组的翻转，会改变原数组。非函数式
console.log(_.reverse(array));
console.log(_.reverse(array));
console.log(_.reverse(array));

const r = _.each(array, (item , index) => { console.log(index, item) });
console.log(r);

